package com.chonglie;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;

public class ActivityLifecycleActivity2 extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_lifecycle2);
		Log.e("Activity2", "onCreate");

		EditText editText = (EditText) findViewById(R.id.intent2_text);

		Intent intent = getIntent();
		editText.setText(intent.getStringExtra(ActivityLifecycleActivity1.MSG));

	}

	@Override
	protected void onStart() {
		super.onStart();
		Log.e("Activity2", "onStart");
	}

	@Override
	protected void onResume() {
		super.onResume();
		Log.e("Activity2", "onResume");
	}

	@Override
	protected void onPause() {
		super.onPause();
		Log.e("Activity2", "onPause");
	}

	@Override
	protected void onStop() {
		super.onStop();
		Log.e("Activity2", "onStop");
	}

	@Override
	protected void onRestart() {
		super.onRestart();
		Log.e("Activity2", "onRestart");
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
		Log.e("Activity2", "onDestroy");
	}

	public void toActivity1(View view) {
		Intent intent = new Intent(this, ActivityLifecycleActivity1.class);
		startActivity(intent);
	}
}
